package org.ansj.solr;

import java.io.Reader;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.ansj.lucene.util.AnsjTokenizer;
import org.ansj.splitWord.analysis.IndexAnalysis;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.util.TokenizerFactory;
import org.apache.lucene.util.AttributeFactory;

/**
 * 
 * 
 * 
 * @author lizx
 * @date 2016-1-20
 * @since 1.0
 * 
 */
public class AnsjTokenizerFactory extends TokenizerFactory {

	public AnsjTokenizerFactory(Map<String, String> args) {
		super(args);

	}

	@Override
	public Tokenizer create(AttributeFactory factory, Reader input) {
		Set<String> filter = new HashSet<String>();

		return new AnsjTokenizer(new IndexAnalysis(input), input, filter, false);
	}

}
